package cn.falconnect.adserver.adapter.persistence.dao;

import java.util.List;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import cn.falconnect.adserver.domain.ad.AppClass;

@Component
public interface AppClassDao {
	
	@Results(value = { @Result(column = "id", property = "id", id = true),
		@Result(column = "parent_id", property = "parentId"),
		@Result(column = "create_date", property = "createDate") })
	@Select("select * from app_classes ")
	public List<AppClass> findAll();
	
//	@Results(value = { @Result(column = "id", property = "id", id = true),
//			@Result(column = "parent_id", property = "parentId"),
//			@Result(column = "create_date", property = "createDate") })
//	@Select("select * from app_classes where update_time >= #{value} ")
//	public List<AppClass> findAfterTime(String warmUpTime);
	
	
	@Results(value = { @Result(column = "id", property = "id", id = true),
			@Result(column = "parent_id", property = "parentId"),
			@Result(column = "create_date", property = "createDate") })
	@Select("select * from app_classes where id = #{value}")
	public AppClass findById(long id);
}
